3.15.50 \(\int \sin (c+d x) (a+b \sin (c+d x))^2 \tan ^2(c+d x) \, dx\) [1450]

3.15.50.1 Optimal result
3.15.50.2 Mathematica [A] (verified)
3.15.50.3 Rubi [A] (verified)
3.15.50.4 Maple [A] (verified)
3.15.50.5 Fricas [A] (verification not implemented)
3.15.50.6 Sympy [F]
3.15.50.7 Maxima [A] (verification not implemented)
3.15.50.8 Giac [A] (verification not implemented)
3.15.50.9 Mupad [B] (verification not implemented)

3.15.50.1 Optimal result

Integrand size = 27, antiderivative size = 94 \[ \int \sin (c+d x) (a+b \sin (c+d x))^2 \tan ^2(c+d x) \, dx=-3 a b x+\frac {\left (a^2+2 b^2\right ) \cos (c+d x)}{d}-\frac {b^2 \cos ^3(c+d x)}{3 d}+\frac {\left (a^2+b^2\right ) \sec (c+d x)}{d}+\frac {3 a b \tan (c+d x)}{d}-\frac {a b \sin ^2(c+d x) \tan (c+d x)}{d} \]

output
-3*a*b*x+(a^2+2*b^2)*cos(d*x+c)/d-1/3*b^2*cos(d*x+c)^3/d+(a^2+b^2)*sec(d*x 
+c)/d+3*a*b*tan(d*x+c)/d-a*b*sin(d*x+c)^2*tan(d*x+c)/d
 
3.15.50.2 Mathematica [A] (verified)

Time = 0.63 (sec) , antiderivative size = 104, normalized size of antiderivative = 1.11 \[ \int \sin (c+d x) (a+b \sin (c+d x))^2 \tan ^2(c+d x) \, dx=\frac {\sec (c+d x) \left (36 a^2+45 b^2-24 \left (a^2+b^2+3 a b (c+d x)\right ) \cos (c+d x)+4 \left (3 a^2+5 b^2\right ) \cos (2 (c+d x))-b^2 \cos (4 (c+d x))+54 a b \sin (c+d x)+6 a b \sin (3 (c+d x))\right )}{24 d} \]

input
Integrate[Sin[c + d*x]*(a + b*Sin[c + d*x])^2*Tan[c + d*x]^2,x]
 
output
(Sec[c + d*x]*(36*a^2 + 45*b^2 - 24*(a^2 + b^2 + 3*a*b*(c + d*x))*Cos[c + 
d*x] + 4*(3*a^2 + 5*b^2)*Cos[2*(c + d*x)] - b^2*Cos[4*(c + d*x)] + 54*a*b* 
Sin[c + d*x] + 6*a*b*Sin[3*(c + d*x)]))/(24*d)
 
3.15.50.3 Rubi [A] (verified)

Time = 0.52 (sec) , antiderivative size = 106, normalized size of antiderivative = 1.13, number of steps used = 11, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.370, Rules used = {3042, 3390, 3042, 3071, 252, 262, 216, 4857, 355, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \sin (c+d x) \tan ^2(c+d x) (a+b \sin (c+d x))^2 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\sin (c+d x)^3 (a+b \sin (c+d x))^2}{\cos (c+d x)^2}dx\)

\(\Big \downarrow \) 3390

\(\displaystyle \int \sin (c+d x) \left (a^2+b^2 \sin ^2(c+d x)\right ) \tan ^2(c+d x)dx+2 a b \int \sin ^2(c+d x) \tan ^2(c+d x)dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \sin (c+d x) \left (a^2+b^2 \sin (c+d x)^2\right ) \tan (c+d x)^2dx+2 a b \int \sin (c+d x)^2 \tan (c+d x)^2dx\)

\(\Big \downarrow \) 3071

\(\displaystyle \int \sin (c+d x) \left (a^2+b^2 \sin (c+d x)^2\right ) \tan (c+d x)^2dx+\frac {2 a b \int \frac {\tan ^4(c+d x)}{\left (\tan ^2(c+d x)+1\right )^2}d\tan (c+d x)}{d}\)

\(\Big \downarrow \) 252

\(\displaystyle \int \sin (c+d x) \left (a^2+b^2 \sin (c+d x)^2\right ) \tan (c+d x)^2dx+\frac {2 a b \left (\frac {3}{2} \int \frac {\tan ^2(c+d x)}{\tan ^2(c+d x)+1}d\tan (c+d x)-\frac {\tan ^3(c+d x)}{2 \left (\tan ^2(c+d x)+1\right )}\right )}{d}\)

\(\Big \downarrow \) 262

\(\displaystyle \int \sin (c+d x) \left (a^2+b^2 \sin (c+d x)^2\right ) \tan (c+d x)^2dx+\frac {2 a b \left (\frac {3}{2} \left (\tan (c+d x)-\int \frac {1}{\tan ^2(c+d x)+1}d\tan (c+d x)\right )-\frac {\tan ^3(c+d x)}{2 \left (\tan ^2(c+d x)+1\right )}\right )}{d}\)

\(\Big \downarrow \) 216

\(\displaystyle \int \sin (c+d x) \left (a^2+b^2 \sin (c+d x)^2\right ) \tan (c+d x)^2dx+\frac {2 a b \left (\frac {3}{2} (\tan (c+d x)-\arctan (\tan (c+d x)))-\frac {\tan ^3(c+d x)}{2 \left (\tan ^2(c+d x)+1\right )}\right )}{d}\)

\(\Big \downarrow \) 4857

\(\displaystyle \frac {2 a b \left (\frac {3}{2} (\tan (c+d x)-\arctan (\tan (c+d x)))-\frac {\tan ^3(c+d x)}{2 \left (\tan ^2(c+d x)+1\right )}\right )}{d}-\frac {\int \left (1-\cos ^2(c+d x)\right ) \left (a^2+b^2-b^2 \cos ^2(c+d x)\right ) \sec ^2(c+d x)d\cos (c+d x)}{d}\)

\(\Big \downarrow \) 355

\(\displaystyle \frac {2 a b \left (\frac {3}{2} (\tan (c+d x)-\arctan (\tan (c+d x)))-\frac {\tan ^3(c+d x)}{2 \left (\tan ^2(c+d x)+1\right )}\right )}{d}-\frac {\int \left (-\left (\left (\frac {2 b^2}{a^2}+1\right ) a^2\right )+b^2 \cos ^2(c+d x)+\left (a^2+b^2\right ) \sec ^2(c+d x)\right )d\cos (c+d x)}{d}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {2 a b \left (\frac {3}{2} (\tan (c+d x)-\arctan (\tan (c+d x)))-\frac {\tan ^3(c+d x)}{2 \left (\tan ^2(c+d x)+1\right )}\right )}{d}-\frac {-\left (a^2+2 b^2\right ) \cos (c+d x)-\left (a^2+b^2\right ) \sec (c+d x)+\frac {1}{3} b^2 \cos ^3(c+d x)}{d}\)

input
Int[Sin[c + d*x]*(a + b*Sin[c + d*x])^2*Tan[c + d*x]^2,x]
 
output
-((-((a^2 + 2*b^2)*Cos[c + d*x]) + (b^2*Cos[c + d*x]^3)/3 - (a^2 + b^2)*Se 
c[c + d*x])/d) + (2*a*b*((3*(-ArcTan[Tan[c + d*x]] + Tan[c + d*x]))/2 - Ta 
n[c + d*x]^3/(2*(1 + Tan[c + d*x]^2))))/d
 

3.15.50.3.1 Defintions of rubi rules used

rule 216
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A 
rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a 
, 0] || GtQ[b, 0])
 

rule 252
Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[c*(c*x 
)^(m - 1)*((a + b*x^2)^(p + 1)/(2*b*(p + 1))), x] - Simp[c^2*((m - 1)/(2*b* 
(p + 1)))   Int[(c*x)^(m - 2)*(a + b*x^2)^(p + 1), x], x] /; FreeQ[{a, b, c 
}, x] && LtQ[p, -1] && GtQ[m, 1] &&  !ILtQ[(m + 2*p + 3)/2, 0] && IntBinomi 
alQ[a, b, c, 2, m, p, x]
 

rule 262
Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[c*(c*x) 
^(m - 1)*((a + b*x^2)^(p + 1)/(b*(m + 2*p + 1))), x] - Simp[a*c^2*((m - 1)/ 
(b*(m + 2*p + 1)))   Int[(c*x)^(m - 2)*(a + b*x^2)^p, x], x] /; FreeQ[{a, b 
, c, p}, x] && GtQ[m, 2 - 1] && NeQ[m + 2*p + 1, 0] && IntBinomialQ[a, b, c 
, 2, m, p, x]
 

rule 355
Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.)*((c_) + (d_.)*(x_)^2)^(q 
_.), x_Symbol] :> Int[ExpandIntegrand[(e*x)^m*(a + b*x^2)^p*(c + d*x^2)^q, 
x], x] /; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b*c - a*d, 0] && IGtQ[p, 0] & 
& IGtQ[q, 0]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3071
Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_S 
ymbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Simp[b*(ff/f)   Subst[I 
nt[(ff*x)^(m + n)/(b^2 + ff^2*x^2)^(m/2 + 1), x], x, b*(Tan[e + f*x]/ff)], 
x]] /; FreeQ[{b, e, f, n}, x] && IntegerQ[m/2]
 

rule 3390
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n 
_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^2, x_Symbol] :> Simp[2*a*(b/d) 
Int[(g*Cos[e + f*x])^p*(d*Sin[e + f*x])^(n + 1), x], x] + Int[(g*Cos[e + f* 
x])^p*(d*Sin[e + f*x])^n*(a^2 + b^2*Sin[e + f*x]^2), x] /; FreeQ[{a, b, d, 
e, f, g, n, p}, x] && NeQ[a^2 - b^2, 0]
 

rule 4857
Int[(u_)*(F_)[(c_.)*((a_.) + (b_.)*(x_))], x_Symbol] :> With[{d = FreeFacto 
rs[Cos[c*(a + b*x)], x]}, Simp[-d/(b*c)   Subst[Int[SubstFor[1, Cos[c*(a + 
b*x)]/d, u, x], x], x, Cos[c*(a + b*x)]/d], x] /; FunctionOfQ[Cos[c*(a + b* 
x)]/d, u, x]] /; FreeQ[{a, b, c}, x] && (EqQ[F, Sin] || EqQ[F, sin])
 
3.15.50.4 Maple [A] (verified)

Time = 0.83 (sec) , antiderivative size = 107, normalized size of antiderivative = 1.14

method result size
parallelrisch \(\frac {\left (12 a^{2}+20 b^{2}\right ) \cos \left (2 d x +2 c \right )-b^{2} \cos \left (4 d x +4 c \right )+6 a b \sin \left (3 d x +3 c \right )+\left (-72 a b x d +48 a^{2}+64 b^{2}\right ) \cos \left (d x +c \right )+54 a b \sin \left (d x +c \right )+36 a^{2}+45 b^{2}}{24 d \cos \left (d x +c \right )}\) \(107\)
derivativedivides \(\frac {a^{2} \left (\frac {\sin ^{4}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )\right )+2 a b \left (\frac {\sin ^{5}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (\sin ^{3}\left (d x +c \right )+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )-\frac {3 d x}{2}-\frac {3 c}{2}\right )+b^{2} \left (\frac {\sin ^{6}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (\frac {8}{3}+\sin ^{4}\left (d x +c \right )+\frac {4 \left (\sin ^{2}\left (d x +c \right )\right )}{3}\right ) \cos \left (d x +c \right )\right )}{d}\) \(147\)
default \(\frac {a^{2} \left (\frac {\sin ^{4}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )\right )+2 a b \left (\frac {\sin ^{5}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (\sin ^{3}\left (d x +c \right )+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )-\frac {3 d x}{2}-\frac {3 c}{2}\right )+b^{2} \left (\frac {\sin ^{6}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (\frac {8}{3}+\sin ^{4}\left (d x +c \right )+\frac {4 \left (\sin ^{2}\left (d x +c \right )\right )}{3}\right ) \cos \left (d x +c \right )\right )}{d}\) \(147\)
risch \(-3 a b x -\frac {i a b \,{\mathrm e}^{2 i \left (d x +c \right )}}{4 d}+\frac {a^{2} {\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {7 b^{2} {\mathrm e}^{i \left (d x +c \right )}}{8 d}+\frac {a^{2} {\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {7 \,{\mathrm e}^{-i \left (d x +c \right )} b^{2}}{8 d}+\frac {i a b \,{\mathrm e}^{-2 i \left (d x +c \right )}}{4 d}+\frac {4 i a b +2 a^{2} {\mathrm e}^{i \left (d x +c \right )}+2 b^{2} {\mathrm e}^{i \left (d x +c \right )}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}-\frac {b^{2} \cos \left (3 d x +3 c \right )}{12 d}\) \(176\)
norman \(\frac {-\frac {12 a^{2}+16 b^{2}}{3 d}+3 a b x -\frac {4 a^{2} \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {2 \left (12 a^{2}+16 b^{2}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {6 a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {10 a b \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {10 a b \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {6 a b \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+6 a b x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-6 a b x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-3 a b x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}\) \(218\)

input
int(sec(d*x+c)^2*sin(d*x+c)^3*(a+b*sin(d*x+c))^2,x,method=_RETURNVERBOSE)
 
output
1/24*((12*a^2+20*b^2)*cos(2*d*x+2*c)-b^2*cos(4*d*x+4*c)+6*a*b*sin(3*d*x+3* 
c)+(-72*a*b*d*x+48*a^2+64*b^2)*cos(d*x+c)+54*a*b*sin(d*x+c)+36*a^2+45*b^2) 
/d/cos(d*x+c)
 
3.15.50.5 Fricas [A] (verification not implemented)

Time = 0.27 (sec) , antiderivative size = 91, normalized size of antiderivative = 0.97 \[ \int \sin (c+d x) (a+b \sin (c+d x))^2 \tan ^2(c+d x) \, dx=-\frac {b^{2} \cos \left (d x + c\right )^{4} + 9 \, a b d x \cos \left (d x + c\right ) - 3 \, {\left (a^{2} + 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - 3 \, a^{2} - 3 \, b^{2} - 3 \, {\left (a b \cos \left (d x + c\right )^{2} + 2 \, a b\right )} \sin \left (d x + c\right )}{3 \, d \cos \left (d x + c\right )} \]

input
integrate(sec(d*x+c)^2*sin(d*x+c)^3*(a+b*sin(d*x+c))^2,x, algorithm="frica 
s")
 
output
-1/3*(b^2*cos(d*x + c)^4 + 9*a*b*d*x*cos(d*x + c) - 3*(a^2 + 2*b^2)*cos(d* 
x + c)^2 - 3*a^2 - 3*b^2 - 3*(a*b*cos(d*x + c)^2 + 2*a*b)*sin(d*x + c))/(d 
*cos(d*x + c))
 
3.15.50.6 Sympy [F]

\[ \int \sin (c+d x) (a+b \sin (c+d x))^2 \tan ^2(c+d x) \, dx=\int \left (a + b \sin {\left (c + d x \right )}\right )^{2} \sin ^{3}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx \]

input
integrate(sec(d*x+c)**2*sin(d*x+c)**3*(a+b*sin(d*x+c))**2,x)
 
output
Integral((a + b*sin(c + d*x))**2*sin(c + d*x)**3*sec(c + d*x)**2, x)
 
3.15.50.7 Maxima [A] (verification not implemented)

Time = 0.29 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.03 \[ \int \sin (c+d x) (a+b \sin (c+d x))^2 \tan ^2(c+d x) \, dx=-\frac {3 \, {\left (3 \, d x + 3 \, c - \frac {\tan \left (d x + c\right )}{\tan \left (d x + c\right )^{2} + 1} - 2 \, \tan \left (d x + c\right )\right )} a b + {\left (\cos \left (d x + c\right )^{3} - \frac {3}{\cos \left (d x + c\right )} - 6 \, \cos \left (d x + c\right )\right )} b^{2} - 3 \, a^{2} {\left (\frac {1}{\cos \left (d x + c\right )} + \cos \left (d x + c\right )\right )}}{3 \, d} \]

input
integrate(sec(d*x+c)^2*sin(d*x+c)^3*(a+b*sin(d*x+c))^2,x, algorithm="maxim 
a")
 
output
-1/3*(3*(3*d*x + 3*c - tan(d*x + c)/(tan(d*x + c)^2 + 1) - 2*tan(d*x + c)) 
*a*b + (cos(d*x + c)^3 - 3/cos(d*x + c) - 6*cos(d*x + c))*b^2 - 3*a^2*(1/c 
os(d*x + c) + cos(d*x + c)))/d
 
3.15.50.8 Giac [A] (verification not implemented)

Time = 0.41 (sec) , antiderivative size = 172, normalized size of antiderivative = 1.83 \[ \int \sin (c+d x) (a+b \sin (c+d x))^2 \tan ^2(c+d x) \, dx=-\frac {9 \, {\left (d x + c\right )} a b + \frac {6 \, {\left (2 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a^{2} + b^{2}\right )}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1} + \frac {2 \, {\left (3 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 3 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 6 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 12 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 3 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, a^{2} - 5 \, b^{2}\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{3}}}{3 \, d} \]

input
integrate(sec(d*x+c)^2*sin(d*x+c)^3*(a+b*sin(d*x+c))^2,x, algorithm="giac" 
)
 
output
-1/3*(9*(d*x + c)*a*b + 6*(2*a*b*tan(1/2*d*x + 1/2*c) + a^2 + b^2)/(tan(1/ 
2*d*x + 1/2*c)^2 - 1) + 2*(3*a*b*tan(1/2*d*x + 1/2*c)^5 - 3*a^2*tan(1/2*d* 
x + 1/2*c)^4 - 3*b^2*tan(1/2*d*x + 1/2*c)^4 - 6*a^2*tan(1/2*d*x + 1/2*c)^2 
 - 12*b^2*tan(1/2*d*x + 1/2*c)^2 - 3*a*b*tan(1/2*d*x + 1/2*c) - 3*a^2 - 5* 
b^2)/(tan(1/2*d*x + 1/2*c)^2 + 1)^3)/d
 
3.15.50.9 Mupad [B] (verification not implemented)

Time = 18.28 (sec) , antiderivative size = 149, normalized size of antiderivative = 1.59 \[ \int \sin (c+d x) (a+b \sin (c+d x))^2 \tan ^2(c+d x) \, dx=-3\,a\,b\,x-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (8\,a^2+\frac {32\,b^2}{3}\right )+4\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+4\,a^2+\frac {16\,b^2}{3}+10\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+10\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+6\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+6\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )\,{\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}^3} \]

input
int((sin(c + d*x)^3*(a + b*sin(c + d*x))^2)/cos(c + d*x)^2,x)
 
output
- 3*a*b*x - (tan(c/2 + (d*x)/2)^2*(8*a^2 + (32*b^2)/3) + 4*a^2*tan(c/2 + ( 
d*x)/2)^4 + 4*a^2 + (16*b^2)/3 + 10*a*b*tan(c/2 + (d*x)/2)^3 + 10*a*b*tan( 
c/2 + (d*x)/2)^5 + 6*a*b*tan(c/2 + (d*x)/2)^7 + 6*a*b*tan(c/2 + (d*x)/2))/ 
(d*(tan(c/2 + (d*x)/2)^2 - 1)*(tan(c/2 + (d*x)/2)^2 + 1)^3)